package org.maylove.wuziqi.common;

import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

public class PasswordProcess {

    //  对密码进行加密
    public static String encrypt(String password) {
        BCryptPasswordEncoder encoder = new BCryptPasswordEncoder();
        return encoder.encode(password);
    }

    //  判断密码是否相同
    public static boolean matches(String password, String encryptedPassword) {
        BCryptPasswordEncoder encoder = new BCryptPasswordEncoder();
        return encoder.matches(password, encryptedPassword);
    }
}
